﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using SiteUnity.Layers.Application.BaseClasses;

namespace SiteUnity.Frame.Modules
{
    [ToolboxData("<{0}:TwitterButton runat=server />")]
    public class TwitterButton : BaseWebControl
    {
        string _template = @"<a href='http://twitter.com/share' class='twitter-share-button' data-count='horizontal'>Tweet</a>";
        protected override void OnPreRender(EventArgs e)
        {
             Page.ClientScript.RegisterClientScriptInclude(typeof(Page), "twitterready", "http://platform.twitter.com/widgets.js");
        }

        protected override void RenderContents(HtmlTextWriter output)
        {
            output.Write(_template);
        }
    }
}
